//
//  Copyright 2011 Alexei "Oleksiy" Puzikov. All rights reserved.
//

//  Cocoa implementation of Three Trackballs user-space driver

#import <Cocoa/Cocoa.h>

@class DDHidMouse;

@interface tb_controller : NSObject {
	NSArray * mMice;
	NSArray * mTrackballs;
}

- (NSArray *) mice;
- (NSArray *) trackBalls;
- (void) setMice: (NSArray *) newMice;
- (void) setTrackballs: (NSArray *) newTrackballs;

- (void) startListening;
- (void) stopListening;

- (int) getTrackballCursorIndex;
- (int) getTrackballButtonIndex;
- (int) getTrackballWheelIndex;
- (int) getTrackballDx: (int) tball;
- (int) getTrackballDy: (int) tball;

- (void) resetTrackball: (int) tball;
- (void) resetTrackballCoordinates: (int) tball;
- (void) resetTrackballWheel: (int) tball;

- (void) setTrackballDx: (int) tball: (int) dx;
- (void) setTrackballDy: (int) tball: (int) dy;

- (int) getTrackballWheel: (int) tball;
- (void) setTrackballWheel: (int) tball: (int) dw;

- (void) mouseCoordinatesTracker:(DDHidMouse *) mouse withDx:(int) dx andDy:(int) dy;
- (void) mouseButtonsTracker:(DDHidMouse *) mouse;
- (void) mouseWheelTracker:(DDHidMouse *) mouse withDx:(int) dx;

- (void) ddhidMouse: (DDHidMouse *) mouse xChanged: (SInt32) deltaX;
- (void) ddhidMouse: (DDHidMouse *) mouse yChanged: (SInt32) deltaY;
- (void) ddhidMouse: (DDHidMouse *) mouse wheelChanged: (SInt32) deltaWheel;

- (void) ddhidMouse: (DDHidMouse *) mouse buttonDown: (unsigned) buttonNumber;
- (void) ddhidMouse: (DDHidMouse *) mouse buttonUp: (unsigned) buttonNumber;

@end
